/**

 Copyright 2001-2011, Motio, Inc.
 All rights reserved.

 **/
package net.emsquared.gamedev.maps;

public class MapCoordinates
{
   private final int tileSize = 32;

   private int x;  // tile indexes
   private int y;

   public MapCoordinates(int aX, int aY)
   {
      x = aX;
      y = aY;
   }

   public int getX()
   {
      return x;
   }

   public void setX(int aX)
   {
      x = aX;
   }

   public int getY()
   {
      return y;
   }

   public void setY(int aY)
   {
      y = aY;
   }

   public float getX_Pix()
   {
      return x * tileSize;
   }

   public float getY_Pix()
   {
      return y * tileSize;
   }

   @Override
   public boolean equals(Object o)
   {
      if (this == o)
         return true;
      if (!(o instanceof MapCoordinates))
         return false;

      MapCoordinates that = (MapCoordinates) o;

      if (x != that.x)
         return false;
      if (y != that.y)
         return false;

      return true;
   }

   @Override
   public int hashCode()
   {
      int result = x;
      result = 31 * result + y;
      return result;
   }
}
